#ifndef SLICECONTOURSEXTRACTOR_H
#define SLICECONTOURSEXTRACTOR_H

#include <QVector3D>
#include <QMatrix4x4>
#include <QVector>
#include <QtMath>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <list>
#include <utility>
#include <QMap>
#include <QSet>
#include <QHash>
#include <QFile>
#include <QQueue>

#include <execution>

#include "ModelFormation.h"

void g0(const Mesh& in_mesh, const QVector3D& in_plane_norm, float in_lambda, Edge& out_edge);

QVector<Mesh> h0(const QVector<Mesh>& stl_model_meshes, const QVector3D& plane_norm, float lambda);

void f1(const QVector<Mesh>& in_model_meshes, const QVector3D& in_plane_norm, float in_lambda, QMap<Vertex, QVector<Vertex>>& out_points_adjoin_map);

void h1(const QVector<Mesh>& in_model_meshes, const QVector3D& in_plane_norm, float in_lambda, QVector<Edge>& links);

void f2(const QMap<Vertex, QVector<Vertex>>& in_points_adjoin_, QVector<QVector<Vertex>>& out_contours);

void h2(const QVector<Edge>& links, QVector<QVector<Vertex>>& contours);

enum MergeType { AEndToBStart, AEndToBEnd, AStartToBStart, AStartToBEnd };

void g3(const QVector<Vertex>& in_seg1, const QVector<Vertex>& in_seg2, float in_adjoin_dis_epsilon, QVector<Vertex>& out_combined_seg);

void f3(QVector<QVector<Vertex>>& mod_contours, float in_adjoin_dis_epsilon);

void g4(QVector<Vertex>& a, QVector<Vertex>& b, float epsilon, QVector<Vertex>& out_combined_contour);

void f4(const QVector<QVector<Vertex>>& contours, float epsilon, QVector<QVector<Vertex>>& out_combined_contour);

#endif // SLICECONTOURSEXTRACTOR_H
